﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using XMK.Tadong.WorkflowBiz.WorkFlow;
using XMK.Utils;

namespace XMK.Tadong.WorkflowBiz.SysCache
{
    public class ArchiveCacheFacade
    {
        public void Init()
        {
            this.InitWorkFlowStatusCache();
            this.InitWorkFlowStatusRuleCache();
        }

        /// <summary>
        /// 缓存状态列表
        /// </summary>
        private void InitWorkFlowStatusCache()
        {
            WorkFlow.WorkFlowMessageStatusCache statusCache = new WorkFlow.WorkFlowMessageStatusCache();
            statusCache.GetInstance();
            CacheHelper.SetCache("statusCache", statusCache);
        }

        /// <summary>
        /// 缓存流程驱动列表
        /// </summary>
        private void InitWorkFlowStatusRuleCache()
        {
            WorkFlowMessageStatusRuleListCache statusRuleCache = new WorkFlowMessageStatusRuleListCache();
            statusRuleCache.GetInstance();
            CacheHelper.SetCache("statusRuleCache", statusRuleCache);
        }

        public WorkFlowMessageStatusCache GetStausCache()
        {
            return CacheHelper.GetCache("statusCache") as WorkFlowMessageStatusCache;
        }

        public WorkFlowMessageStatusRuleListCache GetStatusRuleCache()
        {
            return CacheHelper.GetCache("statusRuleCache") as WorkFlowMessageStatusRuleListCache;
        }
    }
}
